package com.ldr.custom.spring.v3.beans;

import com.ldr.custom.spring.v3.core.GPFactoryBean;
import lombok.Data;

@Data
public class GPBeanWrapper extends GPFactoryBean {

    //还会用到观察者模式
    //支持事件响应，会有一个监听
    private GPBeanPostProcessor postProcessor;

    private Object wrapperInstance;
    //原生的通过反射new出来，要把它包装起来，存下来
    private Object originalInstance;


    public GPBeanWrapper(Object instance) {
        this.originalInstance = instance;
        //创建单例对象
        this.wrapperInstance = instance;
    }





    /**
     * 返回代理以后代class
     * 可能会是这个$Proxy0
     */
    public Class<?> getWrapperClass() {
        return this.wrapperInstance.getClass();
    }

}
